import request from '@/utils/request'

// 监控连接参数
export function configConnect(params) {
  return request({
    url: '/screen/monitor/config/details',
    method: 'get',
    params
  })
}

// 监控连接参数修改
export function configconnectSave(data) {
  return request({
    url: '/screen/monitor/config',
    method: 'put',
    data
  })
}

// 监控查询参数
export function configParameter(params) {
  return request({
    url: '/screen/monitor/parameter/details',
    method: 'get',
    params
  })
}

// 监控查询参数修改
export function configParameterSave(data) {
  return request({
    url: '/screen/monitor/parameter',
    method: 'put',
    data
  })
}

// 虚拟数据模板下载
export function getVirtualTemplate(params) {
  return request({
    url: '/screen/weVirtualData/template',
    method: 'get',
    params
  })
}

// 智慧车间-环保数据详情
export function getRealTimeEnvironmental(params) {
  return request({
    url: '/screen/config/details',
    method: 'get',
    params
  })
}

// 智慧车间-环保数据修改
export function realTimeEnvironmentalSave(data) {
  return request({
    url: '/screen/config',
    method: 'put',
    data:data
  })
}

// 虚拟数据模板修改
export function updateVirtual(data) {
  return request({
    url: '/system/config/virtualData',
    method: 'put',
    data
  })
}

// 获取车间虚拟数据信息
export function getWorkshopList(params) {
  return request({
    url: '/screen/weVirtualData/getWorkshopList',
    method: 'get',
    params
  })
}

// 修改车间虚拟数据信息
export function updateWorkshop(data) {
  return request({
    url: '/screen/weVirtualData/editWorkshopById',
    method: 'put',
    data
  })
}

// 刷新参数缓存
export function refreshCache() {
  return request({
    url: '/system/config/virtualData/refreshCache',
    method: 'delete'
  })
}

// 获取车间工序
export function getWorkshopErpName(params) {
  return request({
    url: '/screen/config/workshopErpName',
    method: 'get',
    params
  })
}

// 修改车间工序
export function updateWorkshopErpName(data) {
  return request({
    url: '/screen/config/workshopErpName',
    method: 'put',
    data
  })
}